<template >
  <div>
    <div>
      <el-input style=font-size:25px
        type="textarea"
        :rows="6"
        placeholder="内容为空，请联系管理员"
        v-model="textarea"
      >
      </el-input>
    </div>

    <el-upload
      class="upload-demo"
      action="https://jsonplaceholder.typicode.com/posts/"
      :on-preview="handlePreview"
      :on-remove="handleRemove"
      :before-remove="beforeRemove"
      multiple
      :limit="2"
      :on-exceed="handleExceed"
      :file-list="fileList"
    >
      <el-button size="small" type="primary">提交作业</el-button>
    </el-upload>
   

    <h1 style="font-size:25px;color:gray">案例推荐</h1>

    <div v-for="o in recomendList" :key="o" style="margin-top:20px">
      <el-tag style="font-size:25px"><router-link :to="{ path: '/learn', query: { learnId: o.id } }">
         {{o.name}}
         </router-link></el-tag>
    </div>



  </div>


  
</template>

<script>
import { findById } from "@/api/getJudicial_document_data.js";
import {findByDocId} from "@/api/getDocumentRecommendData.js";
export default {
  data() {
    return {
      textarea: "111",
      recomendList:[]
    };
  },

  methods: {
    async findById() {
      const result = await findById(this.$route.query.analyseId).then()
      {
        this.textarea = result.data.data.text;
        console.log(result.data.data.text);
      }
    },
    async findByDocId()
    {
      const result = await findByDocId(this.$route.query.analyseId).then()
      {
        this.recomendList = result.data.data
      }

    }
  },
  created() {
    this.findById();
    this.findByDocId();
  },
};
</script>